package com.example.controller;


import com.example.entity.Student;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.ArrayList;
import java.util.List;

@Controller
public class IndexController {

    @GetMapping("/index")
    public String index() {

//        model.addAttribute("hello", "传递的内容");
//
//        Student student = new Student();
//        student.setId(1);
//        student.setName("zhangsan");
//        student.setSex(0);
//        List<String> hobby = new ArrayList<>();
//        hobby.add("sleep");
//        hobby.add("basketball");
//        student.setHobby(hobby);
//        model.addAttribute("student", student);
        return "index";

    }

    @GetMapping("/comment/{id}")
    public String common(@PathVariable("id") int id){
        return "comment/"+id;
    }

    @GetMapping("/vip/{id}")
    public String vip(@PathVariable("id") int id){
        return "vip/"+id;
    }


}

